package com.hex.liyue.giftmodule.presenter;

import com.hex.liyue.commonmodule.manager.HttpManager;
import com.hex.liyue.commonmodule.manager.UserManager;
import com.hex.liyue.commonmodule.net.ResponseListener;
import com.hex.liyue.commonmodule.utils.L;
import com.hex.liyue.giftmodule.bean.HarverDetailsBean;
import com.hex.liyue.giftmodule.bean.HarvesGiftsBean;


/**
 * Created by $cmm on 2016/6/21.
 * <p/>
 * 收货的礼物列表的业务类
 */
public class HarvesDetailsPresenter {
    private IHarvesDetilsGiftsView iHarvesDetilsGiftsView;

    public HarvesDetailsPresenter(IHarvesDetilsGiftsView iHarvesDetilsGiftsView) {
        this.iHarvesDetilsGiftsView = iHarvesDetilsGiftsView;
    }

    public void getHarvesDetialsGifts(String user_gift_export_id ) {
        iHarvesDetilsGiftsView.showLod("加载中...");
        HttpManager.getInstance().getHarvesDetialsGifts(UserManager.getUserId(),user_gift_export_id, new ResponseListener<HarverDetailsBean>() {
            @Override
            public void onSuccess(HarverDetailsBean harverDetailsBean) {
                L.e("harverDetailsBean", harverDetailsBean.toString());
                iHarvesDetilsGiftsView.closeLod();
                iHarvesDetilsGiftsView.setAdapter(harverDetailsBean);
            }

            @Override
            public void onFailure(String responseresult) {
                iHarvesDetilsGiftsView.closeLod();
                iHarvesDetilsGiftsView.showT(responseresult);
            }
        });
    }
}